package org.deltaset.secured.log;

import java.util.logging.Handler;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import org.slf4j.bridge.SLF4JBridgeHandler;

/**
 *
 * @author dmakariev
 */
public class EnableSLF4JBridgeHandler {

    public EnableSLF4JBridgeHandler() {
        init();
    }
    
    
//http://blog.cn-consult.dk/2009/03/bridging-javautillogging-to-slf4j.html
    private static void init() {
        final Logger rootLogger = LogManager.getLogManager().getLogger("");
        final Handler[] handlers = rootLogger.getHandlers();
        for (int i = 0; i < handlers.length; i++) {
            rootLogger.removeHandler(handlers[i]);
        }
        SLF4JBridgeHandler.install();
    }
}
